/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Game;

import java.io.IOException;
import javax.microedition.lcdui.*;
import javax.microedition.media.Manager;
import javax.microedition.media.MediaException;
import javax.microedition.media.Player;
import javax.microedition.midlet.*;

/**
 * @author Vinicio Gomez
 */
public class Menu extends MIDlet implements CommandListener, ItemCommandListener {
    
    private boolean midletPaused = false;

//<editor-fold defaultstate="collapsed" desc=" Generated Fields ">//GEN-BEGIN:|fields|0|
    private Form menuForm;
    private ImageItem imageItem;
    private TextBox creditosBox;
    private TextBox AyudaBox;
    private Form ProgramarForm;
    private StringItem stringItem1;
    private StringItem stringItem;
    private Spacer spacer;
    private StringItem stringItem3;
    private StringItem stringItem2;
    private StringItem stringItem4;
    private StringItem stringItem6;
    private StringItem stringItem7;
    private GameDriver Treasure;
    private Form Win;
    private StringItem stringItem5;
    private ImageItem imageItem1;
    private GameDriver gameDriver1;
    private List Maps;
    private Command backCommand;
    private Command exitCommand;
    private Command ayuda;
    private Command mapa;
    private Command jugar;
    private Command compilar;
    private Command creditos;
    private Command ayudaMapaCommand;
    private Command backCommand1;
    private Command programar;
    private Command backCommand2;
    private Command compilar1;
    private Command backCommand3;
    private Command backCommand4;
    private Command abrir;
    private Command backCommand5;
    private Command guardar1;
    private Command guardar;
    private Command backCommand6;
    private Command cargar1;
    private Command cargar;
    private Command abrir1;
    private Command backCommand8;
    private Command backCommand7;
    private Command Abrir2;
    private Command itemCommand3;
    private Command compilar2;
    private Command guardar2;
    private Command itemCommand;
    private Command itemCommand1;
    private Command itemCommand2;
    private Command backCommand9;
    private Command Guardar3;
    private Command cargar2;
    private Command okCommand;
    private Command okCommand1;
    private Command screenCommand;
    private Command backCommand11;
    private Command okCommand2;
    private Command backCommand10;
    private Command backCommand12;
    private Command screenCommand1;
    private Command itemCommand4;
    private Command itemCommand5;
    private Command itemCommand6;
    private Image menu;
    private Image image1;
//</editor-fold>//GEN-END:|fields|0|
    //private RunGame juego = new RunGame(); 
    private GameDriver game;
    private Thread t;
    public String[]instrucciones = new String[100];
    public int contador = 0;
    public String up    = "Up()";
    public String down  = "Down()";
    public String right = "Right()";
    public String left  = "Left()";
    //private Programab program = new Programab();
    private int[] instrucciones_traduc =new int[100];
    
    private String writeFile, writeContents;
    public int[][] map = new int[20][20];

    
    public int[][] elmapa;
    final int[][] mapa1={
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0},
                {0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0},
                {0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0},
                {0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1},
                {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0}
            };
    final int[][] mapa2={
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
                {1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0},
                {0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0}
            };
    final int[][] mapa3={
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
            };
            
    /**
     * The Menu constructor.
     */
    public Menu() {
    }

//<editor-fold defaultstate="collapsed" desc=" Generated Methods ">//GEN-BEGIN:|methods|0|
//</editor-fold>//GEN-END:|methods|0|
//<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">//GEN-BEGIN:|0-initialize|0|0-preInitialize
    /**
     * Initializes the application. It is called only once when the MIDlet is
     * started. The method is called before the
     * <code>startMIDlet</code> method.
     */
    private void initialize() {//GEN-END:|0-initialize|0|0-preInitialize
        // write pre-initialize user code here
//GEN-LINE:|0-initialize|1|0-postInitialize
        // write post-initialize user code here
    }//GEN-BEGIN:|0-initialize|2|
//</editor-fold>//GEN-END:|0-initialize|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Method: startMIDlet ">//GEN-BEGIN:|3-startMIDlet|0|3-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Started point.
     */
    public void startMIDlet() {//GEN-END:|3-startMIDlet|0|3-preAction
        // write pre-action user code here
//GEN-LINE:|3-startMIDlet|1|3-postAction
        // write post-action user code here
        switchDisplayable(null, getMenuForm());
        try {
            Player p1;
            p1 = Manager.createPlayer(this.getClass().getResourceAsStream("/pirat3.wav"), "audio/x-wav");
            p1.setLoopCount(2);
            p1.realize();
            p1.prefetch();
            p1.start();
        } catch (IOException ioe) {
        } catch (MediaException me) {
        }
    }//GEN-BEGIN:|3-startMIDlet|2|
//</editor-fold>//GEN-END:|3-startMIDlet|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Method: resumeMIDlet ">//GEN-BEGIN:|4-resumeMIDlet|0|4-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Resumed point.
     */
    public void resumeMIDlet() {//GEN-END:|4-resumeMIDlet|0|4-preAction
        // write pre-action user code here
        switchDisplayable(null, getMenuForm());//GEN-LINE:|4-resumeMIDlet|1|4-postAction
        // write post-action user code here
    }//GEN-BEGIN:|4-resumeMIDlet|2|
//</editor-fold>//GEN-END:|4-resumeMIDlet|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">//GEN-BEGIN:|5-switchDisplayable|0|5-preSwitch
    /**
     * Switches a current displayable in a display. The
     * <code>display</code> instance is taken from
     * <code>getDisplay</code> method. This method is used by all actions in the
     * design for switching displayable.
     *
     * @param alert the Alert which is temporarily set to the display;
     * if <code>null</code>, then <code>nextDisplayable</code> is set
     * immediately
     * @param nextDisplayable the Displayable to be set
     */
    public void switchDisplayable(Alert alert, Displayable nextDisplayable) {//GEN-END:|5-switchDisplayable|0|5-preSwitch
        // write pre-switch user code here
        Display display = getDisplay();//GEN-BEGIN:|5-switchDisplayable|1|5-postSwitch
        if (alert == null) {
            display.setCurrent(nextDisplayable);
        } else {
            display.setCurrent(alert, nextDisplayable);
        }//GEN-END:|5-switchDisplayable|1|5-postSwitch
        // write post-switch user code here
    }//GEN-BEGIN:|5-switchDisplayable|2|
//</editor-fold>//GEN-END:|5-switchDisplayable|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Displayables ">//GEN-BEGIN:|7-commandAction|0|7-preCommandAction
    /**
     * Called by a system to indicated that a command has been invoked on a
     * particular displayable.
     *
     * @param command the Command that was invoked
     * @param displayable the Displayable where the command was invoked
     */
    public void commandAction(Command command, Displayable displayable) {//GEN-END:|7-commandAction|0|7-preCommandAction
        // write pre-action user code here
        if (displayable == AyudaBox) {//GEN-BEGIN:|7-commandAction|1|83-preAction
            if (command == backCommand4) {//GEN-END:|7-commandAction|1|83-preAction
                // write pre-action user code here
                switchDisplayable(null, getMenuForm());//GEN-LINE:|7-commandAction|2|83-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|3|185-preAction
        } else if (displayable == Maps) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|3|185-preAction
                // write pre-action user code here
                MapsAction();//GEN-LINE:|7-commandAction|4|185-postAction
                // write post-action user code here
                switchDisplayable(null, getMenuForm());
            } else if (command == backCommand12) {//GEN-LINE:|7-commandAction|5|192-preAction
                // write pre-action user code here
                switchDisplayable(null, getMenuForm());//GEN-LINE:|7-commandAction|6|192-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|7|119-preAction
        } else if (displayable == ProgramarForm) {
            if (command == backCommand8) {//GEN-END:|7-commandAction|7|119-preAction
                // write pre-action user code here
                switchDisplayable(null, getMenuForm());//GEN-LINE:|7-commandAction|8|119-postAction
                // write post-action user code here
            } else if (command == compilar2) {//GEN-LINE:|7-commandAction|9|142-preAction
                // write pre-action user code here
                instrucciones_traduc[contador]=-1;
                switchDisplayable(null, getGameDriver1());//GEN-LINE:|7-commandAction|10|142-postAction
                // write post-action user code here
                //int instrucciones_traduc[]={32,32,2,32,32,64,64,32,32};
                
                //switchDisplayable(null, getGame(instrucciones_traduc));
            }//GEN-BEGIN:|7-commandAction|11|161-preAction
        } else if (displayable == Treasure) {
            if (command == backCommand10) {//GEN-END:|7-commandAction|11|161-preAction
                // write pre-action user code here
                switchDisplayable(null, getMenuForm());//GEN-LINE:|7-commandAction|12|161-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|13|177-preAction
        } else if (displayable == Win) {
            if (command == screenCommand1) {//GEN-END:|7-commandAction|13|177-preAction
                // write pre-action user code here
                switchDisplayable(null, getMenuForm());//GEN-LINE:|7-commandAction|14|177-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|15|68-preAction
        } else if (displayable == creditosBox) {
            if (command == backCommand2) {//GEN-END:|7-commandAction|15|68-preAction
                // write pre-action user code here
                switchDisplayable(null, getMenuForm());//GEN-LINE:|7-commandAction|16|68-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|17|169-preAction
        } else if (displayable == gameDriver1) {
            if (command == backCommand11) {//GEN-END:|7-commandAction|17|169-preAction
                // write pre-action user code here
                switchDisplayable(null, getProgramarForm());//GEN-LINE:|7-commandAction|18|169-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|19|24-preAction
        } else if (displayable == menuForm) {
            if (command == ayuda) {//GEN-END:|7-commandAction|19|24-preAction
                // write pre-action user code here
                switchDisplayable(null, getAyudaBox());//GEN-LINE:|7-commandAction|20|24-postAction
                // write post-action user code here
            } else if (command == creditos) {//GEN-LINE:|7-commandAction|21|60-preAction
                // write pre-action user code here
                switchDisplayable(null, getCreditosBox());//GEN-LINE:|7-commandAction|22|60-postAction
                // write post-action user code here
            } else if (command == exitCommand) {//GEN-LINE:|7-commandAction|23|20-preAction
                // write pre-action user code here
                exitMIDlet();//GEN-LINE:|7-commandAction|24|20-postAction
                // write post-action user code here
            } else if (command == jugar) {//GEN-LINE:|7-commandAction|25|28-preAction
                // write pre-action user code here
                switchDisplayable(null, getTreasure());//GEN-LINE:|7-commandAction|26|28-postAction
                // write post-action user code here
                //juego.getGame().addCommand(getBackCommand10());
                //menuForm.setCommandListener(this);                                  
                //switchDisplayable(null, getGame());
            } else if (command == mapa) {//GEN-LINE:|7-commandAction|27|26-preAction
                // write pre-action user code here
                switchDisplayable(null, getMaps());//GEN-LINE:|7-commandAction|28|26-postAction
                // write post-action user code here
            } else if (command == programar) {//GEN-LINE:|7-commandAction|29|72-preAction
                // write pre-action user code here
                switchDisplayable(null, getProgramarForm());//GEN-LINE:|7-commandAction|30|72-postAction
                // write post-action user code here
                //switchDisplayable(null, program.getForm());
            }//GEN-BEGIN:|7-commandAction|31|7-postCommandAction
        }//GEN-END:|7-commandAction|31|7-postCommandAction
        // write post-action user code here
    }//GEN-BEGIN:|7-commandAction|32|
//</editor-fold>//GEN-END:|7-commandAction|32|









//<editor-fold defaultstate="collapsed" desc=" Generated Getter: menuForm ">//GEN-BEGIN:|14-getter|0|14-preInit
    /**
     * Returns an initialized instance of menuForm component.
     *
     * @return the initialized component instance
     */
    public Form getMenuForm() {
        if (menuForm == null) {//GEN-END:|14-getter|0|14-preInit
            // write pre-init user code here
            menuForm = new Form("Menu", new Item[]{getImageItem()});//GEN-BEGIN:|14-getter|1|14-postInit
            menuForm.addCommand(getExitCommand());
            menuForm.addCommand(getAyuda());
            menuForm.addCommand(getJugar());
            menuForm.addCommand(getMapa());
            menuForm.addCommand(getProgramar());
            menuForm.addCommand(getCreditos());
            menuForm.setCommandListener(this);//GEN-END:|14-getter|1|14-postInit
            // write post-init user code here
        }//GEN-BEGIN:|14-getter|2|
        return menuForm;
    }
//</editor-fold>//GEN-END:|14-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem ">//GEN-BEGIN:|15-getter|0|15-preInit
    /**
     * Returns an initialized instance of imageItem component.
     *
     * @return the initialized component instance
     */
    public ImageItem getImageItem() {
        if (imageItem == null) {//GEN-END:|15-getter|0|15-preInit
            // write pre-init user code here
            imageItem = new ImageItem("", getMenu(), ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER | Item.LAYOUT_2, "<Missing Image>");//GEN-LINE:|15-getter|1|15-postInit
            // write post-init user code here
        }//GEN-BEGIN:|15-getter|2|
        return imageItem;
    }
//</editor-fold>//GEN-END:|15-getter|2|











//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand ">//GEN-BEGIN:|17-getter|0|17-preInit
    /**
     * Returns an initialized instance of backCommand component.
     *
     * @return the initialized component instance
     */
    public Command getBackCommand() {
        if (backCommand == null) {//GEN-END:|17-getter|0|17-preInit
            // write pre-init user code here
            backCommand = new Command("Atras", Command.BACK, 0);//GEN-LINE:|17-getter|1|17-postInit
            // write post-init user code here
        }//GEN-BEGIN:|17-getter|2|
        return backCommand;
    }
//</editor-fold>//GEN-END:|17-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: exitCommand ">//GEN-BEGIN:|19-getter|0|19-preInit
    /**
     * Returns an initialized instance of exitCommand component.
     *
     * @return the initialized component instance
     */
    public Command getExitCommand() {
        if (exitCommand == null) {//GEN-END:|19-getter|0|19-preInit
            // write pre-init user code here
            exitCommand = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|19-getter|1|19-postInit
            // write post-init user code here
        }//GEN-BEGIN:|19-getter|2|
        return exitCommand;
    }
//</editor-fold>//GEN-END:|19-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ayuda ">//GEN-BEGIN:|23-getter|0|23-preInit
    /**
     * Returns an initialized instance of ayuda component.
     *
     * @return the initialized component instance
     */
    public Command getAyuda() {
        if (ayuda == null) {//GEN-END:|23-getter|0|23-preInit
            // write pre-init user code here
            ayuda = new Command("Help", Command.HELP, 0);//GEN-LINE:|23-getter|1|23-postInit
            // write post-init user code here
        }//GEN-BEGIN:|23-getter|2|
        return ayuda;
    }
//</editor-fold>//GEN-END:|23-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: mapa ">//GEN-BEGIN:|25-getter|0|25-preInit
    /**
     * Returns an initialized instance of mapa component.
     *
     * @return the initialized component instance
     */
    public Command getMapa() {
        if (mapa == null) {//GEN-END:|25-getter|0|25-preInit
            // write pre-init user code here
            mapa = new Command("Map", Command.SCREEN, 0);//GEN-LINE:|25-getter|1|25-postInit
            // write post-init user code here
        }//GEN-BEGIN:|25-getter|2|
        return mapa;
    }
//</editor-fold>//GEN-END:|25-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: jugar ">//GEN-BEGIN:|27-getter|0|27-preInit
    /**
     * Returns an initialized instance of jugar component.
     *
     * @return the initialized component instance
     */
    public Command getJugar() {
        if (jugar == null) {//GEN-END:|27-getter|0|27-preInit
            // write pre-init user code here
            jugar = new Command("Play", Command.SCREEN, 0);//GEN-LINE:|27-getter|1|27-postInit
            // write post-init user code here
        }//GEN-BEGIN:|27-getter|2|
        return jugar;
    }
//</editor-fold>//GEN-END:|27-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: compilar ">//GEN-BEGIN:|45-getter|0|45-preInit
    /**
     * Returns an initialized instance of compilar component.
     *
     * @return the initialized component instance
     */
    public Command getCompilar() {
        if (compilar == null) {//GEN-END:|45-getter|0|45-preInit
            // write pre-init user code here
            compilar = new Command("Compilar", Command.OK, 0);//GEN-LINE:|45-getter|1|45-postInit
            // write post-init user code here
        }//GEN-BEGIN:|45-getter|2|
        return compilar;
    }
//</editor-fold>//GEN-END:|45-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: menu ">//GEN-BEGIN:|16-getter|0|16-preInit
    /**
     * Returns an initialized instance of menu component.
     *
     * @return the initialized component instance
     */
    public Image getMenu() {
        if (menu == null) {//GEN-END:|16-getter|0|16-preInit
            // write pre-init user code here
            try {//GEN-BEGIN:|16-getter|1|16-@java.io.IOException
                menu = Image.createImage("/Dibujos/Menu.png");
            } catch (java.io.IOException e) {//GEN-END:|16-getter|1|16-@java.io.IOException
                
            }//GEN-LINE:|16-getter|2|16-postInit
            // write post-init user code here
        }//GEN-BEGIN:|16-getter|3|
        return menu;
    }
//</editor-fold>//GEN-END:|16-getter|3|



//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ayudaMapaCommand ">//GEN-BEGIN:|56-getter|0|56-preInit
    /**
     * Returns an initialized instance of ayudaMapaCommand component.
     *
     * @return the initialized component instance
     */
    public Command getAyudaMapaCommand() {
        if (ayudaMapaCommand == null) {//GEN-END:|56-getter|0|56-preInit
            // write pre-init user code here
            ayudaMapaCommand = new Command("Ayuda", Command.HELP, 0);//GEN-LINE:|56-getter|1|56-postInit
            // write post-init user code here
        }//GEN-BEGIN:|56-getter|2|
        return ayudaMapaCommand;
    }
//</editor-fold>//GEN-END:|56-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: creditosBox ">//GEN-BEGIN:|66-getter|0|66-preInit
    /**
     * Returns an initialized instance of creditosBox component.
     *
     * @return the initialized component instance
     */
    public TextBox getCreditosBox() {
        if (creditosBox == null) {//GEN-END:|66-getter|0|66-preInit
            // write pre-init user code here
            creditosBox = new TextBox("Credits", "Universidad del Valle de Guatemala 2012\nAlgoritmos y Estructuras de Datos\n\nDevelopers:\n-Rodrigo Medrano\n-Rodrigo Mej\u00EDa\n-Douglas D\u00E1vila\n-Vinicio G\u00F3mez\n\nArt designer:\n-Gabriela Ruggeri\n\nInspired by:\n-RoboMind\u00AE\n\nMusic:\nKlaus Badelt - He\'s a Pirate", 300, TextField.ANY | TextField.UNEDITABLE);//GEN-BEGIN:|66-getter|1|66-postInit
            creditosBox.addCommand(getBackCommand2());
            creditosBox.setCommandListener(this);//GEN-END:|66-getter|1|66-postInit
            // write post-init user code here
        }//GEN-BEGIN:|66-getter|2|
        return creditosBox;
    }
//</editor-fold>//GEN-END:|66-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: creditos ">//GEN-BEGIN:|59-getter|0|59-preInit
    /**
     * Returns an initialized instance of creditos component.
     *
     * @return the initialized component instance
     */
    public Command getCreditos() {
        if (creditos == null) {//GEN-END:|59-getter|0|59-preInit
            // write pre-init user code here
            creditos = new Command("Credits", Command.SCREEN, 0);//GEN-LINE:|59-getter|1|59-postInit
            // write post-init user code here
        }//GEN-BEGIN:|59-getter|2|
        return creditos;
    }
//</editor-fold>//GEN-END:|59-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand1 ">//GEN-BEGIN:|62-getter|0|62-preInit
    /**
     * Returns an initialized instance of backCommand1 component.
     *
     * @return the initialized component instance
     */
    public Command getBackCommand1() {
        if (backCommand1 == null) {//GEN-END:|62-getter|0|62-preInit
            // write pre-init user code here
            backCommand1 = new Command("Back", Command.BACK, 0);//GEN-LINE:|62-getter|1|62-postInit
            // write post-init user code here
        }//GEN-BEGIN:|62-getter|2|
        return backCommand1;
    }
//</editor-fold>//GEN-END:|62-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand2 ">//GEN-BEGIN:|67-getter|0|67-preInit
    /**
     * Returns an initialized instance of backCommand2 component.
     *
     * @return the initialized component instance
     */
    public Command getBackCommand2() {
        if (backCommand2 == null) {//GEN-END:|67-getter|0|67-preInit
            // write pre-init user code here
            backCommand2 = new Command("Back", Command.BACK, 0);//GEN-LINE:|67-getter|1|67-postInit
            // write post-init user code here
        }//GEN-BEGIN:|67-getter|2|
        return backCommand2;
    }
//</editor-fold>//GEN-END:|67-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: programar ">//GEN-BEGIN:|71-getter|0|71-preInit
    /**
     * Returns an initialized instance of programar component.
     *
     * @return the initialized component instance
     */
    public Command getProgramar() {
        if (programar == null) {//GEN-END:|71-getter|0|71-preInit
            // write pre-init user code here
            programar = new Command("Program", Command.SCREEN, 0);//GEN-LINE:|71-getter|1|71-postInit
            // write post-init user code here
        }//GEN-BEGIN:|71-getter|2|
        return programar;
    }
//</editor-fold>//GEN-END:|71-getter|2|



//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand3 ">//GEN-BEGIN:|74-getter|0|74-preInit
    /**
     * Returns an initialized instance of backCommand3 component.
     *
     * @return the initialized component instance
     */
    public Command getBackCommand3() {
        if (backCommand3 == null) {//GEN-END:|74-getter|0|74-preInit
            // write pre-init user code here
            backCommand3 = new Command("Atras", Command.BACK, 0);//GEN-LINE:|74-getter|1|74-postInit
            // write post-init user code here
        }//GEN-BEGIN:|74-getter|2|
        return backCommand3;
    }
//</editor-fold>//GEN-END:|74-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: compilar1 ">//GEN-BEGIN:|78-getter|0|78-preInit
    /**
     * Returns an initialized instance of compilar1 component.
     *
     * @return the initialized component instance
     */
    public Command getCompilar1() {
        if (compilar1 == null) {//GEN-END:|78-getter|0|78-preInit
            // write pre-init user code here
            compilar1 = new Command("Compilar", Command.OK, 0);//GEN-LINE:|78-getter|1|78-postInit
            // write post-init user code here
        }//GEN-BEGIN:|78-getter|2|
        return compilar1;
    }
//</editor-fold>//GEN-END:|78-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: AyudaBox ">//GEN-BEGIN:|80-getter|0|80-preInit
    /**
     * Returns an initialized instance of AyudaBox component.
     *
     * @return the initialized component instance
     */
    public TextBox getAyudaBox() {
        if (AyudaBox == null) {//GEN-END:|80-getter|0|80-preInit
            // write pre-init user code here
            AyudaBox = new TextBox("Help", "Treasure is intended for the introduction\nto structured programming.\n\nCreate your maps. Program your moves. Find the treasure.\n\nYarrrr!!!!", 300, TextField.ANY | TextField.UNEDITABLE);//GEN-BEGIN:|80-getter|1|80-postInit
            AyudaBox.addCommand(getBackCommand4());
            AyudaBox.setCommandListener(this);//GEN-END:|80-getter|1|80-postInit
            // write post-init user code here
        }//GEN-BEGIN:|80-getter|2|
        return AyudaBox;
    }
//</editor-fold>//GEN-END:|80-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand4 ">//GEN-BEGIN:|82-getter|0|82-preInit
    /**
     * Returns an initialized instance of backCommand4 component.
     *
     * @return the initialized component instance
     */
    public Command getBackCommand4() {
        if (backCommand4 == null) {//GEN-END:|82-getter|0|82-preInit
            // write pre-init user code here
            backCommand4 = new Command("Back", Command.BACK, 0);//GEN-LINE:|82-getter|1|82-postInit
            // write post-init user code here
        }//GEN-BEGIN:|82-getter|2|
        return backCommand4;
    }
//</editor-fold>//GEN-END:|82-getter|2|



//<editor-fold defaultstate="collapsed" desc=" Generated Getter: abrir ">//GEN-BEGIN:|88-getter|0|88-preInit
    /**
     * Returns an initialized instance of abrir component.
     *
     * @return the initialized component instance
     */
    public Command getAbrir() {
        if (abrir == null) {//GEN-END:|88-getter|0|88-preInit
            // write pre-init user code here
            abrir = new Command("Cargar", Command.SCREEN, 0);//GEN-LINE:|88-getter|1|88-postInit
            // write post-init user code here
        }//GEN-BEGIN:|88-getter|2|
        return abrir;
    }
//</editor-fold>//GEN-END:|88-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand5 ">//GEN-BEGIN:|91-getter|0|91-preInit
    /**
     * Returns an initialized instance of backCommand5 component.
     *
     * @return the initialized component instance
     */
    public Command getBackCommand5() {
        if (backCommand5 == null) {//GEN-END:|91-getter|0|91-preInit
            // write pre-init user code here
            backCommand5 = new Command("Back", Command.BACK, 0);//GEN-LINE:|91-getter|1|91-postInit
            // write post-init user code here
        }//GEN-BEGIN:|91-getter|2|
        return backCommand5;
    }
//</editor-fold>//GEN-END:|91-getter|2|



//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand6 ">//GEN-BEGIN:|98-getter|0|98-preInit
    /**
     * Returns an initialized instance of backCommand6 component.
     *
     * @return the initialized component instance
     */
    public Command getBackCommand6() {
        if (backCommand6 == null) {//GEN-END:|98-getter|0|98-preInit
            // write pre-init user code here
            backCommand6 = new Command("Atras", Command.BACK, 0);//GEN-LINE:|98-getter|1|98-postInit
            // write post-init user code here
        }//GEN-BEGIN:|98-getter|2|
        return backCommand6;
    }
//</editor-fold>//GEN-END:|98-getter|2|



//<editor-fold defaultstate="collapsed" desc=" Generated Getter: guardar ">//GEN-BEGIN:|101-getter|0|101-preInit
    /**
     * Returns an initialized instance of guardar component.
     *
     * @return the initialized component instance
     */
    public Command getGuardar() {
        if (guardar == null) {//GEN-END:|101-getter|0|101-preInit
            // write pre-init user code here
            guardar = new Command("Guardar", Command.OK, 0);//GEN-LINE:|101-getter|1|101-postInit
            // write post-init user code here
        }//GEN-BEGIN:|101-getter|2|
        return guardar;
    }
//</editor-fold>//GEN-END:|101-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: guardar1 ">//GEN-BEGIN:|103-getter|0|103-preInit
    /**
     * Returns an initialized instance of guardar1 component.
     *
     * @return the initialized component instance
     */
    public Command getGuardar1() {
        if (guardar1 == null) {//GEN-END:|103-getter|0|103-preInit
            // write pre-init user code here
            guardar1 = new Command("Guardar", Command.OK, 0);//GEN-LINE:|103-getter|1|103-postInit
            // write post-init user code here
        }//GEN-BEGIN:|103-getter|2|
        return guardar1;
    }
//</editor-fold>//GEN-END:|103-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: abrir1 ">//GEN-BEGIN:|105-getter|0|105-preInit
    /**
     * Returns an initialized instance of abrir1 component.
     *
     * @return the initialized component instance
     */
    public Command getAbrir1() {
        if (abrir1 == null) {//GEN-END:|105-getter|0|105-preInit
            // write pre-init user code here
            abrir1 = new Command("Abrir", Command.SCREEN, 0);//GEN-LINE:|105-getter|1|105-postInit
            // write post-init user code here
        }//GEN-BEGIN:|105-getter|2|
        return abrir1;
    }
//</editor-fold>//GEN-END:|105-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: cargar ">//GEN-BEGIN:|107-getter|0|107-preInit
    /**
     * Returns an initialized instance of cargar component.
     *
     * @return the initialized component instance
     */
    public Command getCargar() {
        if (cargar == null) {//GEN-END:|107-getter|0|107-preInit
            // write pre-init user code here
            cargar = new Command("Cargar", Command.OK, 0);//GEN-LINE:|107-getter|1|107-postInit
            // write post-init user code here
        }//GEN-BEGIN:|107-getter|2|
        return cargar;
    }
//</editor-fold>//GEN-END:|107-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: cargar1 ">//GEN-BEGIN:|109-getter|0|109-preInit
    /**
     * Returns an initialized instance of cargar1 component.
     *
     * @return the initialized component instance
     */
    public Command getCargar1() {
        if (cargar1 == null) {//GEN-END:|109-getter|0|109-preInit
            // write pre-init user code here
            cargar1 = new Command("Cargar", Command.OK, 0);//GEN-LINE:|109-getter|1|109-postInit
            // write post-init user code here
        }//GEN-BEGIN:|109-getter|2|
        return cargar1;
    }
//</editor-fold>//GEN-END:|109-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand7 ">//GEN-BEGIN:|113-getter|0|113-preInit
    /**
     * Returns an initialized instance of backCommand7 component.
     *
     * @return the initialized component instance
     */
    public Command getBackCommand7() {
        if (backCommand7 == null) {//GEN-END:|113-getter|0|113-preInit
            // write pre-init user code here
            backCommand7 = new Command("Atras", Command.BACK, 0);//GEN-LINE:|113-getter|1|113-postInit
            // write post-init user code here
        }//GEN-BEGIN:|113-getter|2|
        return backCommand7;
    }
//</editor-fold>//GEN-END:|113-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ProgramarForm ">//GEN-BEGIN:|117-getter|0|117-preInit
    /**
     * Returns an initialized instance of ProgramarForm component.
     *
     * @return the initialized component instance
     */
    public Form getProgramarForm() {
        if (ProgramarForm == null) {//GEN-END:|117-getter|0|117-preInit
            // write pre-init user code here
            ProgramarForm = new Form("Program", new Item[]{getStringItem4(), getSpacer(), getStringItem(), getStringItem1(), getStringItem2(), getStringItem3(), getStringItem7(), getStringItem6()});//GEN-BEGIN:|117-getter|1|117-postInit
            ProgramarForm.addCommand(getBackCommand8());
            ProgramarForm.addCommand(getCompilar2());
            ProgramarForm.setCommandListener(this);//GEN-END:|117-getter|1|117-postInit
            // write post-init user code here
        }//GEN-BEGIN:|117-getter|2|
        return ProgramarForm;
    }
//</editor-fold>//GEN-END:|117-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem ">//GEN-BEGIN:|126-getter|0|126-preInit
    /**
     * Returns an initialized instance of stringItem component.
     *
     * @return the initialized component instance
     */
    public StringItem getStringItem() {
        if (stringItem == null) {//GEN-END:|126-getter|0|126-preInit
            // write pre-init user code here
            stringItem = new StringItem("", "Up", Item.BUTTON);//GEN-BEGIN:|126-getter|1|126-postInit
            stringItem.addCommand(getItemCommand());
            stringItem.setItemCommandListener(this);
            stringItem.setLayout(ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER | ImageItem.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_EXPAND | Item.LAYOUT_2);//GEN-END:|126-getter|1|126-postInit
            // write post-init user code here
        }//GEN-BEGIN:|126-getter|2|
        return stringItem;
    }
//</editor-fold>//GEN-END:|126-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem1 ">//GEN-BEGIN:|127-getter|0|127-preInit
    /**
     * Returns an initialized instance of stringItem1 component.
     *
     * @return the initialized component instance
     */
    public StringItem getStringItem1() {
        if (stringItem1 == null) {//GEN-END:|127-getter|0|127-preInit
            // write pre-init user code here
            stringItem1 = new StringItem("", "Down", Item.BUTTON);//GEN-BEGIN:|127-getter|1|127-postInit
            stringItem1.addCommand(getItemCommand1());
            stringItem1.setItemCommandListener(this);
            stringItem1.setLayout(ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER | ImageItem.LAYOUT_NEWLINE_BEFORE | ImageItem.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_EXPAND | Item.LAYOUT_VEXPAND | Item.LAYOUT_2);//GEN-END:|127-getter|1|127-postInit
            // write post-init user code here
        }//GEN-BEGIN:|127-getter|2|
        return stringItem1;
    }
//</editor-fold>//GEN-END:|127-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem2 ">//GEN-BEGIN:|128-getter|0|128-preInit
    /**
     * Returns an initialized instance of stringItem2 component.
     *
     * @return the initialized component instance
     */
    public StringItem getStringItem2() {
        if (stringItem2 == null) {//GEN-END:|128-getter|0|128-preInit
            // write pre-init user code here
            stringItem2 = new StringItem("", "Right", Item.BUTTON);//GEN-BEGIN:|128-getter|1|128-postInit
            stringItem2.addCommand(getItemCommand2());
            stringItem2.setItemCommandListener(this);
            stringItem2.setLayout(ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER | ImageItem.LAYOUT_NEWLINE_BEFORE | ImageItem.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_EXPAND | Item.LAYOUT_VEXPAND | Item.LAYOUT_2);//GEN-END:|128-getter|1|128-postInit
            // write post-init user code here
        }//GEN-BEGIN:|128-getter|2|
        return stringItem2;
    }
//</editor-fold>//GEN-END:|128-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem3 ">//GEN-BEGIN:|129-getter|0|129-preInit
    /**
     * Returns an initialized instance of stringItem3 component.
     *
     * @return the initialized component instance
     */
    public StringItem getStringItem3() {
        if (stringItem3 == null) {//GEN-END:|129-getter|0|129-preInit
            // write pre-init user code here
            stringItem3 = new StringItem("", "Left", Item.BUTTON);//GEN-BEGIN:|129-getter|1|129-postInit
            stringItem3.addCommand(getItemCommand3());
            stringItem3.setItemCommandListener(this);
            stringItem3.setLayout(ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER | ImageItem.LAYOUT_NEWLINE_BEFORE | ImageItem.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_EXPAND | Item.LAYOUT_VEXPAND | Item.LAYOUT_2);//GEN-END:|129-getter|1|129-postInit
            // write post-init user code here
        }//GEN-BEGIN:|129-getter|2|
        return stringItem3;
    }
//</editor-fold>//GEN-END:|129-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem4 ">//GEN-BEGIN:|130-getter|0|130-preInit
    /**
     * Returns an initialized instance of stringItem4 component.
     *
     * @return the initialized component instance
     */
    public StringItem getStringItem4() {
        if (stringItem4 == null) {//GEN-END:|130-getter|0|130-preInit
            // write pre-init user code here
            stringItem4 = new StringItem("Code:", "");//GEN-BEGIN:|130-getter|1|130-postInit
            stringItem4.setLayout(ImageItem.LAYOUT_LEFT | Item.LAYOUT_TOP | Item.LAYOUT_VCENTER | ImageItem.LAYOUT_NEWLINE_BEFORE | ImageItem.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_EXPAND | Item.LAYOUT_VEXPAND | Item.LAYOUT_2);//GEN-END:|130-getter|1|130-postInit
            // write post-init user code here
            //stringItem4.setItemCommandListener(this);
        }//GEN-BEGIN:|130-getter|2|
        return stringItem4;
    }
//</editor-fold>//GEN-END:|130-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand8 ">//GEN-BEGIN:|118-getter|0|118-preInit
    /**
     * Returns an initialized instance of backCommand8 component.
     *
     * @return the initialized component instance
     */
    public Command getBackCommand8() {
        if (backCommand8 == null) {//GEN-END:|118-getter|0|118-preInit
            // write pre-init user code here
            backCommand8 = new Command("Back", Command.BACK, 0);//GEN-LINE:|118-getter|1|118-postInit
            // write post-init user code here
        }//GEN-BEGIN:|118-getter|2|
        return backCommand8;
    }
//</editor-fold>//GEN-END:|118-getter|2|

    
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: Abrir2 ">//GEN-BEGIN:|122-getter|0|122-preInit
    /**
     * Returns an initialized instance of Abrir2 component.
     *
     * @return the initialized component instance
     */
    public Command getAbrir2() {
        if (Abrir2 == null) {//GEN-END:|122-getter|0|122-preInit
            // write pre-init user code here
            Abrir2 = new Command("Abrir", Command.SCREEN, 0);//GEN-LINE:|122-getter|1|122-postInit
            // write post-init user code here
        }//GEN-BEGIN:|122-getter|2|
        return Abrir2;
    }
//</editor-fold>//GEN-END:|122-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Items ">//GEN-BEGIN:|8-itemCommandAction|0|8-preItemCommandAction
    /**
     * Called by a system to indicated that a command has been invoked on a
     * particular item.
     *
     * @param command the Command that was invoked
     * @param displayable the Item where the command was invoked
     */
    public void commandAction(Command command, Item item) {//GEN-END:|8-itemCommandAction|0|8-preItemCommandAction
        // write pre-action user code here
        if (item == stringItem) {//GEN-BEGIN:|8-itemCommandAction|1|132-preAction
            if (command == itemCommand) {//GEN-END:|8-itemCommandAction|1|132-preAction
                // write pre-action user code here
                stringItem4.setText(stringItem4.getText()+up+"    ");
                instrucciones[contador] = up;
                instrucciones_traduc[contador] = 2; 
                contador ++;
//GEN-LINE:|8-itemCommandAction|2|132-postAction
                // write post-action user code here
            }//GEN-BEGIN:|8-itemCommandAction|3|134-preAction
        } else if (item == stringItem1) {
            if (command == itemCommand1) {//GEN-END:|8-itemCommandAction|3|134-preAction
                // write pre-action user code here
                stringItem4.setText(stringItem4.getText()+down+"  ");
                instrucciones[contador] = down;
                instrucciones_traduc[contador] = 64;
                contador ++;
//GEN-LINE:|8-itemCommandAction|4|134-postAction
                // write post-action user code here
            }//GEN-BEGIN:|8-itemCommandAction|5|136-preAction
        } else if (item == stringItem2) {
            if (command == itemCommand2) {//GEN-END:|8-itemCommandAction|5|136-preAction
                // write pre-action user code here
                stringItem4.setText(stringItem4.getText()+right+" ");
                instrucciones[contador] = right;
                instrucciones_traduc[contador] = 32;
                contador ++;
//GEN-LINE:|8-itemCommandAction|6|136-postAction
                // write post-action user code here
            }//GEN-BEGIN:|8-itemCommandAction|7|138-preAction
        } else if (item == stringItem3) {
            if (command == itemCommand3) {//GEN-END:|8-itemCommandAction|7|138-preAction
                // write pre-action user code here
                stringItem4.setText(stringItem4.getText()+left+"  ");
                instrucciones[contador] = left;
                instrucciones_traduc[contador] = 4;
                contador ++;
//GEN-LINE:|8-itemCommandAction|8|138-postAction
                // write post-action user code here
            }//GEN-BEGIN:|8-itemCommandAction|9|182-preAction
        } else if (item == stringItem6) {
            if (command == itemCommand4) {//GEN-END:|8-itemCommandAction|9|182-preAction
                // write pre-action user code here
                stringItem4.setText("");
                instrucciones= new String[100];
                contador=0;
                instrucciones_traduc= new int[100];
//GEN-LINE:|8-itemCommandAction|10|182-postAction
                // write post-action user code here
            }//GEN-BEGIN:|8-itemCommandAction|11|199-preAction
        } else if (item == stringItem7) {
            if (command == itemCommand6) {//GEN-END:|8-itemCommandAction|11|199-preAction
                // write pre-action user code here
                stringItem4.setText(stringItem4.getText().substring(0, stringItem4.getText().length() -8));
                contador--;
//GEN-LINE:|8-itemCommandAction|12|199-postAction
                // write post-action user code here
            }//GEN-BEGIN:|8-itemCommandAction|13|8-postItemCommandAction
        }//GEN-END:|8-itemCommandAction|13|8-postItemCommandAction
        // write post-action user code here
    }//GEN-BEGIN:|8-itemCommandAction|14|
//</editor-fold>//GEN-END:|8-itemCommandAction|14|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommand ">//GEN-BEGIN:|131-getter|0|131-preInit
    /**
     * Returns an initialized instance of itemCommand component.
     *
     * @return the initialized component instance
     */
    public Command getItemCommand() {
        if (itemCommand == null) {//GEN-END:|131-getter|0|131-preInit
            // write pre-init user code here
            itemCommand = new Command("Ok", Command.ITEM, 0);//GEN-LINE:|131-getter|1|131-postInit
            // write post-init user code here
        }//GEN-BEGIN:|131-getter|2|
        return itemCommand;
    }
//</editor-fold>//GEN-END:|131-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommand1 ">//GEN-BEGIN:|133-getter|0|133-preInit
    /**
     * Returns an initialized instance of itemCommand1 component.
     *
     * @return the initialized component instance
     */
    public Command getItemCommand1() {
        if (itemCommand1 == null) {//GEN-END:|133-getter|0|133-preInit
            // write pre-init user code here
            itemCommand1 = new Command("Ok", Command.ITEM, 0);//GEN-LINE:|133-getter|1|133-postInit
            // write post-init user code here
        }//GEN-BEGIN:|133-getter|2|
        return itemCommand1;
    }
//</editor-fold>//GEN-END:|133-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommand2 ">//GEN-BEGIN:|135-getter|0|135-preInit
    /**
     * Returns an initialized instance of itemCommand2 component.
     *
     * @return the initialized component instance
     */
    public Command getItemCommand2() {
        if (itemCommand2 == null) {//GEN-END:|135-getter|0|135-preInit
            // write pre-init user code here
            itemCommand2 = new Command("Ok", Command.ITEM, 0);//GEN-LINE:|135-getter|1|135-postInit
            // write post-init user code here
        }//GEN-BEGIN:|135-getter|2|
        return itemCommand2;
    }
//</editor-fold>//GEN-END:|135-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommand3 ">//GEN-BEGIN:|137-getter|0|137-preInit
    /**
     * Returns an initialized instance of itemCommand3 component.
     *
     * @return the initialized component instance
     */
    public Command getItemCommand3() {
        if (itemCommand3 == null) {//GEN-END:|137-getter|0|137-preInit
            // write pre-init user code here
            itemCommand3 = new Command("Ok", Command.ITEM, 0);//GEN-LINE:|137-getter|1|137-postInit
            // write post-init user code here
        }//GEN-BEGIN:|137-getter|2|
        return itemCommand3;
    }
//</editor-fold>//GEN-END:|137-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: spacer ">//GEN-BEGIN:|140-getter|0|140-preInit
    /**
     * Returns an initialized instance of spacer component.
     *
     * @return the initialized component instance
     */
    public Spacer getSpacer() {
        if (spacer == null) {//GEN-END:|140-getter|0|140-preInit
            // write pre-init user code here
            spacer = new Spacer(16, 1);//GEN-LINE:|140-getter|1|140-postInit
            // write post-init user code here
        }//GEN-BEGIN:|140-getter|2|
        return spacer;
    }
//</editor-fold>//GEN-END:|140-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: compilar2 ">//GEN-BEGIN:|141-getter|0|141-preInit
    /**
     * Returns an initialized instance of compilar2 component.
     *
     * @return the initialized component instance
     */
    public Command getCompilar2() {
        if (compilar2 == null) {//GEN-END:|141-getter|0|141-preInit
            // write pre-init user code here
            compilar2 = new Command("Compile", Command.OK, 0);//GEN-LINE:|141-getter|1|141-postInit
            // write post-init user code here
        }//GEN-BEGIN:|141-getter|2|
        return compilar2;
    }
//</editor-fold>//GEN-END:|141-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: guardar2 ">//GEN-BEGIN:|143-getter|0|143-preInit
    /**
     * Returns an initialized instance of guardar2 component.
     *
     * @return the initialized component instance
     */
    public Command getGuardar2() {
        if (guardar2 == null) {//GEN-END:|143-getter|0|143-preInit
            // write pre-init user code here
            guardar2 = new Command("Guardar", Command.OK, 0);//GEN-LINE:|143-getter|1|143-postInit
            // write post-init user code here
        }//GEN-BEGIN:|143-getter|2|
        return guardar2;
    }
//</editor-fold>//GEN-END:|143-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: cargar2 ">//GEN-BEGIN:|145-getter|0|145-preInit
    /**
     * Returns an initialized instance of cargar2 component.
     *
     * @return the initialized component instance
     */
    public Command getCargar2() {
        if (cargar2 == null) {//GEN-END:|145-getter|0|145-preInit
            // write pre-init user code here
            cargar2 = new Command("Cargar", Command.OK, 0);//GEN-LINE:|145-getter|1|145-postInit
            // write post-init user code here
        }//GEN-BEGIN:|145-getter|2|
        return cargar2;
    }
//</editor-fold>//GEN-END:|145-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand ">//GEN-BEGIN:|147-getter|0|147-preInit
    /**
     * Returns an initialized instance of okCommand component.
     *
     * @return the initialized component instance
     */
    public Command getOkCommand() {
        if (okCommand == null) {//GEN-END:|147-getter|0|147-preInit
            // write pre-init user code here
            okCommand = new Command("Open", Command.OK, 0);//GEN-LINE:|147-getter|1|147-postInit
            // write post-init user code here
        }//GEN-BEGIN:|147-getter|2|
        return okCommand;
    }
//</editor-fold>//GEN-END:|147-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand1 ">//GEN-BEGIN:|150-getter|0|150-preInit
    /**
     * Returns an initialized instance of okCommand1 component.
     *
     * @return the initialized component instance
     */
    public Command getOkCommand1() {
        if (okCommand1 == null) {//GEN-END:|150-getter|0|150-preInit
            // write pre-init user code here
            okCommand1 = new Command("Ok", Command.OK, 0);//GEN-LINE:|150-getter|1|150-postInit
            // write post-init user code here
        }//GEN-BEGIN:|150-getter|2|
        return okCommand1;
    }
//</editor-fold>//GEN-END:|150-getter|2|



//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand9 ">//GEN-BEGIN:|154-getter|0|154-preInit
    /**
     * Returns an initialized instance of backCommand9 component.
     *
     * @return the initialized component instance
     */
    public Command getBackCommand9() {
        if (backCommand9 == null) {//GEN-END:|154-getter|0|154-preInit
            // write pre-init user code here
            backCommand9 = new Command("Back", Command.BACK, 0);//GEN-LINE:|154-getter|1|154-postInit
            // write post-init user code here
        }//GEN-BEGIN:|154-getter|2|
        return backCommand9;
    }
//</editor-fold>//GEN-END:|154-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: Guardar3 ">//GEN-BEGIN:|157-getter|0|157-preInit
    /**
     * Returns an initialized instance of Guardar3 component.
     *
     * @return the initialized component instance
     */
    public Command getGuardar3() {
        if (Guardar3 == null) {//GEN-END:|157-getter|0|157-preInit
            // write pre-init user code here
            Guardar3 = new Command("Guardar", Command.OK, 0);//GEN-LINE:|157-getter|1|157-postInit
            // write post-init user code here
        }//GEN-BEGIN:|157-getter|2|
        return Guardar3;
    }
//</editor-fold>//GEN-END:|157-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: Treasure ">//GEN-BEGIN:|159-getter|0|159-preInit
    /**
     * Returns an initialized instance of Treasure component.
     *
     * @return the initialized component instance
     */
    public GameDriver getTreasure() {
        if (Treasure == null) {//GEN-END:|159-getter|0|159-preInit
            // write pre-init user code here
            Treasure = new GameDriver(this, elmapa, null);//GEN-BEGIN:|159-getter|1|159-postInit
            Treasure.setTitle("Treasure");
            Treasure.addCommand(getBackCommand10());
            Treasure.setCommandListener(this);//GEN-END:|159-getter|1|159-postInit
            // write post-init user code here
            this.t = new Thread(Treasure);
            t.start();
          }
        else{
            Treasure = new GameDriver(this, elmapa);
            Treasure.setTitle("Treasure");
            Treasure.addCommand(getBackCommand10());
            Treasure.setCommandListener(this);
            // write post-init user code here
            this.t = new Thread(Treasure);
            t.start();
        }//GEN-BEGIN:|159-getter|2|
        return Treasure;
    }
//</editor-fold>//GEN-END:|159-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand10 ">//GEN-BEGIN:|160-getter|0|160-preInit
    /**
     * Returns an initialized instance of backCommand10 component.
     *
     * @return the initialized component instance
     */
    public Command getBackCommand10() {
        if (backCommand10 == null) {//GEN-END:|160-getter|0|160-preInit
            // write pre-init user code here
            backCommand10 = new Command("Back", Command.BACK, 0);//GEN-LINE:|160-getter|1|160-postInit
            // write post-init user code here
        }//GEN-BEGIN:|160-getter|2|
        return backCommand10;
    }
//</editor-fold>//GEN-END:|160-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand2 ">//GEN-BEGIN:|163-getter|0|163-preInit
    /**
     * Returns an initialized instance of okCommand2 component.
     *
     * @return the initialized component instance
     */
    public Command getOkCommand2() {
        if (okCommand2 == null) {//GEN-END:|163-getter|0|163-preInit
            // write pre-init user code here
            okCommand2 = new Command("prueba", Command.OK, 0);//GEN-LINE:|163-getter|1|163-postInit
            // write post-init user code here
        }//GEN-BEGIN:|163-getter|2|
        return okCommand2;
    }
//</editor-fold>//GEN-END:|163-getter|2|



//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand11 ">//GEN-BEGIN:|168-getter|0|168-preInit
    /**
     * Returns an initialized instance of backCommand11 component.
     *
     * @return the initialized component instance
     */
    public Command getBackCommand11() {
        if (backCommand11 == null) {//GEN-END:|168-getter|0|168-preInit
            // write pre-init user code here
            backCommand11 = new Command("Back", Command.BACK, 0);//GEN-LINE:|168-getter|1|168-postInit
            // write post-init user code here
        }//GEN-BEGIN:|168-getter|2|
        return backCommand11;
    }
//</editor-fold>//GEN-END:|168-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: gameDriver1 ">//GEN-BEGIN:|166-getter|0|166-preInit
    /**
     * Returns an initialized instance of gameDriver1 component.
     *
     * @return the initialized component instance
     */
    public GameDriver getGameDriver1() {
        if (gameDriver1 == null) {//GEN-END:|166-getter|0|166-preInit
            // write pre-init user code here
            
            gameDriver1 = new GameDriver(this, elmapa, instrucciones_traduc, null);//GEN-BEGIN:|166-getter|1|166-postInit
            gameDriver1.setTitle("Treasure");
            gameDriver1.addCommand(getBackCommand11());
            gameDriver1.setCommandListener(this);//GEN-END:|166-getter|1|166-postInit
            // write post-init user code here
            this.t = new Thread(gameDriver1);
            t.start();
        }
        else{
            gameDriver1 = new GameDriver(this, elmapa, instrucciones_traduc, null);
            gameDriver1.setTitle("gameDriver1");
            gameDriver1.addCommand(getBackCommand11());
            gameDriver1.setCommandListener(this);
            // write post-init user code here
            this.t = new Thread(gameDriver1);
            t.start();
        }//GEN-BEGIN:|166-getter|2|
        return gameDriver1;
    }
//</editor-fold>//GEN-END:|166-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: screenCommand ">//GEN-BEGIN:|171-getter|0|171-preInit
    /**
     * Returns an initialized instance of screenCommand component.
     *
     * @return the initialized component instance
     */
    public Command getScreenCommand() {
        if (screenCommand == null) {//GEN-END:|171-getter|0|171-preInit
            // write pre-init user code here
            screenCommand = new Command("Screen", Command.SCREEN, 0);//GEN-LINE:|171-getter|1|171-postInit
            // write post-init user code here
        }//GEN-BEGIN:|171-getter|2|
        return screenCommand;
    }
//</editor-fold>//GEN-END:|171-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: Win ">//GEN-BEGIN:|175-getter|0|175-preInit
    /**
     * Returns an initialized instance of Win component.
     *
     * @return the initialized component instance
     */
    public Form getWin() {
        if (Win == null) {//GEN-END:|175-getter|0|175-preInit
            // write pre-init user code here
            Win = new Form("", new Item[]{getStringItem5(), getImageItem1()});//GEN-BEGIN:|175-getter|1|175-postInit
            Win.addCommand(getScreenCommand1());
            Win.setCommandListener(this);//GEN-END:|175-getter|1|175-postInit
            // write post-init user code here
        }//GEN-BEGIN:|175-getter|2|
        return Win;
    }
//</editor-fold>//GEN-END:|175-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem5 ">//GEN-BEGIN:|179-getter|0|179-preInit
    /**
     * Returns an initialized instance of stringItem5 component.
     *
     * @return the initialized component instance
     */
    public StringItem getStringItem5() {
        if (stringItem5 == null) {//GEN-END:|179-getter|0|179-preInit
            // write pre-init user code here
            stringItem5 = new StringItem("", "Yaaarr!! You find the Treasure!");//GEN-BEGIN:|179-getter|1|179-postInit
            stringItem5.setLayout(ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER | ImageItem.LAYOUT_NEWLINE_BEFORE | ImageItem.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_EXPAND | Item.LAYOUT_VEXPAND | Item.LAYOUT_2);//GEN-END:|179-getter|1|179-postInit
            // write post-init user code here
        }//GEN-BEGIN:|179-getter|2|
        return stringItem5;
    }
//</editor-fold>//GEN-END:|179-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: screenCommand1 ">//GEN-BEGIN:|176-getter|0|176-preInit
    /**
     * Returns an initialized instance of screenCommand1 component.
     *
     * @return the initialized component instance
     */
    public Command getScreenCommand1() {
        if (screenCommand1 == null) {//GEN-END:|176-getter|0|176-preInit
            // write pre-init user code here
            screenCommand1 = new Command("Menu", Command.SCREEN, 0);//GEN-LINE:|176-getter|1|176-postInit
            // write post-init user code here
        }//GEN-BEGIN:|176-getter|2|
        return screenCommand1;
    }
//</editor-fold>//GEN-END:|176-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem6 ">//GEN-BEGIN:|180-getter|0|180-preInit
    /**
     * Returns an initialized instance of stringItem6 component.
     *
     * @return the initialized component instance
     */
    public StringItem getStringItem6() {
        if (stringItem6 == null) {//GEN-END:|180-getter|0|180-preInit
            // write pre-init user code here
            stringItem6 = new StringItem("", "Erase All", Item.BUTTON);//GEN-BEGIN:|180-getter|1|180-postInit
            stringItem6.addCommand(getItemCommand4());
            stringItem6.setItemCommandListener(this);
            stringItem6.setLayout(ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER | ImageItem.LAYOUT_NEWLINE_BEFORE | ImageItem.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_EXPAND | Item.LAYOUT_VEXPAND | Item.LAYOUT_2);//GEN-END:|180-getter|1|180-postInit
            // write post-init user code here
        }//GEN-BEGIN:|180-getter|2|
        return stringItem6;
    }
//</editor-fold>//GEN-END:|180-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommand4 ">//GEN-BEGIN:|181-getter|0|181-preInit
    /**
     * Returns an initialized instance of itemCommand4 component.
     *
     * @return the initialized component instance
     */
    public Command getItemCommand4() {
        if (itemCommand4 == null) {//GEN-END:|181-getter|0|181-preInit
            // write pre-init user code here
            itemCommand4 = new Command("Ok", Command.ITEM, 0);//GEN-LINE:|181-getter|1|181-postInit
            // write post-init user code here
        }//GEN-BEGIN:|181-getter|2|
        return itemCommand4;
    }
//</editor-fold>//GEN-END:|181-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: Maps ">//GEN-BEGIN:|183-getter|0|183-preInit
    /**
     * Returns an initialized instance of Maps component.
     *
     * @return the initialized component instance
     */
    public List getMaps() {
        if (Maps == null) {//GEN-END:|183-getter|0|183-preInit
            // write pre-init user code here
            Maps = new List("Maps", Choice.IMPLICIT);//GEN-BEGIN:|183-getter|1|183-postInit
            Maps.append("The Labyrinth", null);
            Maps.append("The Island", null);
            Maps.append("Just Sand", null);
            Maps.addCommand(getBackCommand12());
            Maps.setCommandListener(this);
            Maps.setSelectedFlags(new boolean[]{false, false, false});//GEN-END:|183-getter|1|183-postInit
            // write post-init user code here
        }//GEN-BEGIN:|183-getter|2|
        return Maps;
    }
//</editor-fold>//GEN-END:|183-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Method: MapsAction ">//GEN-BEGIN:|183-action|0|183-preAction
    /**
     * Performs an action assigned to the selected list element in the Maps
     * component.
     */
    public void MapsAction() {//GEN-END:|183-action|0|183-preAction
        // enter pre-action user code here
        String __selectedString = getMaps().getString(getMaps().getSelectedIndex());//GEN-BEGIN:|183-action|1|187-preAction
        if (__selectedString != null) {
            if (__selectedString.equals("The Labyrinth")) {//GEN-END:|183-action|1|187-preAction
                // write pre-action user code here
                elmapa = mapa1;
//GEN-LINE:|183-action|2|187-postAction
                // write post-action user code here
            } else if (__selectedString.equals("The Island")) {//GEN-LINE:|183-action|3|188-preAction
                // write pre-action user code here
                elmapa = mapa2;
//GEN-LINE:|183-action|4|188-postAction
                // write post-action user code here
            } else if (__selectedString.equals("Just Sand")) {//GEN-LINE:|183-action|5|189-preAction
                // write pre-action user code here
                elmapa = mapa3;
//GEN-LINE:|183-action|6|189-postAction
                // write post-action user code here
            }//GEN-BEGIN:|183-action|7|183-postAction
        }//GEN-END:|183-action|7|183-postAction
        // enter post-action user code here
    }//GEN-BEGIN:|183-action|8|
//</editor-fold>//GEN-END:|183-action|8|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand12 ">//GEN-BEGIN:|191-getter|0|191-preInit
    /**
     * Returns an initialized instance of backCommand12 component.
     *
     * @return the initialized component instance
     */
    public Command getBackCommand12() {
        if (backCommand12 == null) {//GEN-END:|191-getter|0|191-preInit
            // write pre-init user code here
            backCommand12 = new Command("Back", Command.BACK, 0);//GEN-LINE:|191-getter|1|191-postInit
            // write post-init user code here
        }//GEN-BEGIN:|191-getter|2|
        return backCommand12;
    }
//</editor-fold>//GEN-END:|191-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem1 ">//GEN-BEGIN:|194-getter|0|194-preInit
    /**
     * Returns an initialized instance of imageItem1 component.
     *
     * @return the initialized component instance
     */
    public ImageItem getImageItem1() {
        if (imageItem1 == null) {//GEN-END:|194-getter|0|194-preInit
            // write pre-init user code here
            imageItem1 = new ImageItem("", getImage1(), ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER | ImageItem.LAYOUT_NEWLINE_BEFORE | ImageItem.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_EXPAND | Item.LAYOUT_VEXPAND | Item.LAYOUT_2, "<Missing Image>");//GEN-LINE:|194-getter|1|194-postInit
            // write post-init user code here
        }//GEN-BEGIN:|194-getter|2|
        return imageItem1;
    }
//</editor-fold>//GEN-END:|194-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: image1 ">//GEN-BEGIN:|195-getter|0|195-preInit
    /**
     * Returns an initialized instance of image1 component.
     *
     * @return the initialized component instance
     */
    public Image getImage1() {
        if (image1 == null) {//GEN-END:|195-getter|0|195-preInit
            // write pre-init user code here
            try {//GEN-BEGIN:|195-getter|1|195-@java.io.IOException
                image1 = Image.createImage("/Dibujos/win.png");
            } catch (java.io.IOException e) {//GEN-END:|195-getter|1|195-@java.io.IOException
                
            }//GEN-LINE:|195-getter|2|195-postInit
            // write post-init user code here
        }//GEN-BEGIN:|195-getter|3|
        return image1;
    }
//</editor-fold>//GEN-END:|195-getter|3|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommand5 ">//GEN-BEGIN:|196-getter|0|196-preInit
    /**
     * Returns an initialized instance of itemCommand5 component.
     *
     * @return the initialized component instance
     */
    public Command getItemCommand5() {
        if (itemCommand5 == null) {//GEN-END:|196-getter|0|196-preInit
            // write pre-init user code here
            itemCommand5 = new Command("Item", Command.ITEM, 0);//GEN-LINE:|196-getter|1|196-postInit
            // write post-init user code here
        }//GEN-BEGIN:|196-getter|2|
        return itemCommand5;
    }
//</editor-fold>//GEN-END:|196-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem7 ">//GEN-BEGIN:|197-getter|0|197-preInit
    /**
     * Returns an initialized instance of stringItem7 component.
     *
     * @return the initialized component instance
     */
    public StringItem getStringItem7() {
        if (stringItem7 == null) {//GEN-END:|197-getter|0|197-preInit
            // write pre-init user code here
            stringItem7 = new StringItem("", "Erase", Item.BUTTON);//GEN-BEGIN:|197-getter|1|197-postInit
            stringItem7.addCommand(getItemCommand6());
            stringItem7.setItemCommandListener(this);//GEN-END:|197-getter|1|197-postInit
            // write post-init user code here
        }//GEN-BEGIN:|197-getter|2|
        return stringItem7;
    }
//</editor-fold>//GEN-END:|197-getter|2|

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommand6 ">//GEN-BEGIN:|198-getter|0|198-preInit
    /**
     * Returns an initialized instance of itemCommand6 component.
     *
     * @return the initialized component instance
     */
    public Command getItemCommand6() {
        if (itemCommand6 == null) {//GEN-END:|198-getter|0|198-preInit
            // write pre-init user code here
            itemCommand6 = new Command("Ok", Command.ITEM, 0);//GEN-LINE:|198-getter|1|198-postInit
            // write post-init user code here
        }//GEN-BEGIN:|198-getter|2|
        return itemCommand6;
    }
//</editor-fold>//GEN-END:|198-getter|2|

    /**
     * Returns a display instance.
     *
     * @return the display instance.
     */
    public Display getDisplay() {
        return Display.getDisplay(this);
    }

    /**
     * Exits MIDlet.
     */
    public void exitMIDlet() {
        switchDisplayable(null, null);
        destroyApp(true);
        notifyDestroyed();
    }

    /**
     * Called when MIDlet is started. Checks whether the MIDlet have been
     * already started and initialize/starts or resumes the MIDlet.
     */
    public void startApp() {
        if (midletPaused) {
            resumeMIDlet();
        } else {
            initialize();
            startMIDlet();
        }
        midletPaused = false;
    }

    /**
     * Called when MIDlet is paused.
     */
    public void pauseApp() {
        midletPaused = true;
    }

    /**
     * Called to signal the MIDlet to terminate.
     *
     * @param unconditional if true, then the MIDlet has to be unconditionally
     * terminated and all resources has to be released.
     */
    public void destroyApp(boolean unconditional) {
    }   
}
